package com.junko.core.base;

import com.github.pagehelper.PageInfo;
import com.junko.model.PageForm;
import com.junko.model.BaseModel;

import java.util.List;

public interface BaseService<T extends BaseModel> {

    boolean insert(T record);

    boolean insertSelective(T record);

    T selectByPrimaryKey(Object id);

    boolean updateByPrimaryKey(T record);

    boolean updateByPrimaryKeySelective(T record);

    boolean deleteByPrimaryKey(Object id);

    List<T> findTop(int top, String statementKey, Object parameter);

    T findTopOne(String statementKey, Object parameter);

    PageInfo<T> pageFind(String statementKey, PageForm pageForm, Object parameter);

    <M> PageInfo<M> pageFindModel(String statementKey, PageForm pageForm, Object parameter);
}